import { Router } from "express";
import { type Response } from "express";

const users = {
  "admin-token": {
    roles: ["admin"],
    introduction: "I am a super administrator",
    avatar:
      "https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif",
    name: "Super Admin",
  },
  "editor-token": {
    roles: ["editor"],
    introduction: "I am an editor",
    avatar:
      "https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif",
    name: "Normal Editor",
  },
};

const router = Router();

/**
 * @description  登录
 */
router.post("/login", (req: any, res: any) => {
  return res.json({
    code: 20000,
    data: "tokentokentokentokentokentokentoken",
    msg: "登录成功",
  });
});

/**
 * @description  获取个人信息
 */
router.get("/info", (req: any, res: any) => {
  return res.json({
    code: 20000,
    data: {
      roles: ["admin"],
      introduction: "I am a super administrator",
      avatar:
        "https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif",
      name: "Super Admin",
    },
    msg: "登录成功",
  });
});

// router.use("/list", listRouter);
export default router;
